

$(function(){
    //开公司
    $("#catalog>ul>li:eq(0)").hover(function(){
        var $li1 = $("#catalog>ul>li:eq(0)");

        $(".inner1").css("backgroundColor","#fff");
        $(".inner1").children("i").css("color","#01bbf4");
        $(".inner1").children("p").css("color","#000");
        $.ajax({
            url:"../index/json/menu1.json",
            type:"post",
            dataType:"json",
            success:function(res){

                var openCpy = $("<ul class='openCpy'></ul>");
                for(var i=0;i<res.length;i++){
                    var items = $("<li class='clear'></li>");
                    for(var key in res[i]){
                        var tempHTML =$("<div>"+res[i][key].toString().replace(/,/g,"")+"</div>");
                        items.append(tempHTML);
                    }
                    openCpy.append(items);
                }
                $li1.append(openCpy);
                $li1.children(".openCpy").css("width","0")
                $li1.children(".openCpy").animate({width:749},500)
            }
        })

    },function(){
        $("#catalog>ul>li:eq(0)").children(".openCpy").remove();
        $(".inner1").css("backgroundColor","");
        $(".inner1").children("i").css("color","#fff");
        $(".inner1").children("p").css("color","#fff");

    })
    //代记账
    $("#catalog>ul>li:eq(1)").hover(function(){
        var $li2 = $("#catalog>ul>li:eq(1)");

        $(".inner2").css("backgroundColor","#fff");
        $(".inner2").children("i").css("color","#01bbf4");
        $(".inner2").children("p").css("color","#000");
        $.ajax({
            url:"../index/json/menu2.json",
            type:"post",
            dataType:"json",
            success:function(res){

                var rplAccount = $("<ul class='rplAccount'></ul>");

                for(var i=0;i<res.length;i++){
                    var items = $("<li class='clear'></li>");
                    for(var key in res[i]){
                        var tempHTML =$("<div>"+res[i][key].toString().replace(/,/g,"")+"</div>");
                        items.append(tempHTML);
                    }
                    rplAccount.append(items);
                }
                $li2.append(rplAccount);
                $li2.children(".rplAccount").css("width","0")
                $li2.children(".rplAccount").animate({width:749},500)
            }
        })
    },function(){
        $("#catalog>ul>li:eq(1)").children(".rplAccount").remove();
        $(".inner2").css("backgroundColor","");
        $(".inner2").children("i").css("color","#fff");
        $(".inner2").children("p").css("color","#fff");

    })
    //办税务
    $("#catalog>ul>li:eq(2)").hover(function(){
        var $li3 = $("#catalog>ul>li:eq(2)");

        $(".inner3").css("backgroundColor","#fff");
        $(".inner3").children("i").css("color","#01bbf4");
        $(".inner3").children("p").css("color","#000");
        $.ajax({
            url:"../index/json/menu3.json",
            type:"post",
            dataType:"json",
            success:function(res){

                var hdlTax = $("<ul class='hdlTax'></ul>");
                for(var i=0;i<res.length;i++){
                    var items = $("<li class='clear'></li>");
                    for(var key in res[i]){
                        var tempHTML =$("<div>"+res[i][key].toString().replace(/,/g,"")+"</div>");
                        items.append(tempHTML);
                    }
                    hdlTax.append(items);
                }
                $li3.append(hdlTax);
                $li3.children(".hdlTax").css("width","0")
                $li3.children(".hdlTax").animate({width:749},500)
            }
        })
    },function(){
        $("#catalog>ul>li:eq(2)").children(".hdlTax").remove();
        $(".inner3").css("backgroundColor","");
        $(".inner3").children("i").css("color","#fff");
        $(".inner3").children("p").css("color","#fff");

    })
    //做审计
    $("#catalog>ul>li:eq(3)").hover(function(){
        var $li4 = $("#catalog>ul>li:eq(3)");

        $(".inner4").css("backgroundColor","#fff");
        $(".inner4").children("i").css("color","#01bbf4");
        $(".inner4").children("p").css("color","#000");
        $.ajax({
            url:"../index/json/menu4.json",
            type:"post",
            dataType:"json",
            success:function(res){

                var doAudit = $("<ul class='doAudit'></ul>");
                for(var i=0;i<res.length;i++){
                    var items = $("<li class='clear'></li>");
                    for(var key in res[i]){
                        var tempHTML =$("<div>"+res[i][key].toString().replace(/,/g,"")+"</div>");
                        items.append(tempHTML);
                    }
                    doAudit.append(items);
                }
                $li4.append(doAudit);
                $li4.children(".doAudit").css("width","0")
                $li4.children(".doAudit").animate({width:749},500)
            }
        })
    },function(){
        $("#catalog>ul>li:eq(3)").children(".doAudit").remove();
        $(".inner4").css("backgroundColor","");
        $(".inner4").children("i").css("color","#fff");
        $(".inner4").children("p").css("color","#fff");

    })
    //节税款
    $("#catalog>ul>li:eq(4)").hover(function(){
        var $li5 = $("#catalog>ul>li:eq(4)");

        $(".inner5").css("backgroundColor","#fff");
        $(".inner5").children("i").css("color","#01bbf4");
        $(".inner5").children("p").css("color","#000");
        $.ajax({
            url:"../index/json/menu5.json",
            type:"post",
            dataType:"json",
            success:function(res){

                var taxSect= $("<ul class='taxSect'></ul>");
                for(var i=0;i<res.length;i++){
                    var items = $("<li class='clear'></li>");
                    for(var key in res[i]){
                        var tempHTML =$("<div>"+res[i][key].toString().replace(/,/g,"")+"</div>");
                        items.append(tempHTML);
                    }
                    taxSect.append(items);
                }
                $li5.append(taxSect);
                $li5.children(".taxSect").css("width","0")
                $li5.children(".taxSect").animate({width:749},500)
            }
        })
    },function(){
        $("#catalog>ul>li:eq(4)").children(".taxSect").remove();
        $(".inner5").css("backgroundColor","");
        $(".inner5").children("i").css("color","#fff");
        $(".inner5").children("p").css("color","#fff");

    })
})